const express = require('express');
const router = express.Router();
// 添加列表
router.get('/add', (req, res) => {
    console.log(req.query);
    const jsonp = req.query.callback;
    const data = {
        name: '张三0',
    }
    res.send(`${jsonp}(${JSON.stringify(data)})`);
    // res.send('添加成功');
});
// 删除列表
router.get('/delete', (req, res) => {
    res.send('删除成功');
});
// 修改列表
//局部中间件
const middleware = (req, res, next) => {
    console.log('局部中间件');
    next();
}
router.get('/update', middleware, (req, res) => {
    console.log(req.query);
    res.send('修改成功');
});
// 查询列表
router.get('/query', (req, res) => {
    res.send('查询成功');
});
module.exports = router;